using System;
using L=Science.Physics.GeneralPhysics;

namespace Serway.Chapter38
{
	/// <summary>
	/// Example07: The Orders of a Diffraction Grating
	/// Monochromatic light from a helium-neon laser
	/// (\lambda = 632.8 nm) is incident normally on 
	/// a diffraction grating containing 6000 grooves
	/// per centimeter. Find the angles at which the
	/// first- and second-order maxima are observed.
	/// </summary>
	public class Example07
	{
		public Example07()
		{
		}
		private string result;
		public string Result
		{
			get{return result;}
		}
		public void Compute()
		{
			L.Optics obj = new L.Optics();
			obj.WaveLength = 632.8E-9;
			obj.DistanceOfSlitSeperation = 1.0E-2/6000.0;
			obj.FindAngleInGratingDiffraction();
			result+=Convert.ToString(obj.AngleOfLine*180.0/Math.PI)+"\r\n";
			obj.OrderNumber = 2;
			obj.FindAngleInGratingDiffraction();
			result+=Convert.ToString(obj.AngleOfLine*180.0/Math.PI)+"\r\n";
		}
	}
}
